precision mediump float;
uniform sampler2D Blend_Map;
uniform sampler2D Dirt_Map;
uniform sampler2D Grass_Map;
uniform sampler2D Rock_Map;
varying vec2 v_uv; 
varying float e_fog;
void main()
{
	vec4 fog=vec4(1.0,1.0,1.0,1.0);
	float lerpvalue;
	vec4 blend=texture2D(Blend_Map, v_uv);
	vec4 dirt=texture2D(Dirt_Map, v_uv);
	vec4 grass=texture2D(Grass_Map, v_uv*16.0);
	vec4 rock=texture2D(Rock_Map, v_uv*2.0);
	vec4 frag=(blend.r*dirt+blend.g*grass+blend.b*rock)/(blend.r+blend.g+blend.b);
	
	gl_FragColor = mix(frag,fog,e_fog);
}
